// Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt

frappe.query_reports["Payment Ledger Report CN"] = {
    filters: [
        {
            fieldname: "company",
            label: __("Company"),
            fieldtype: "MultiSelectList",
            options: "Company",
            get_data: function(txt) {
                return frappe.db.get_link_options("Company", txt);
            }
        },
        {
            fieldname: "report_date",
            label: __("Report Date"),
            fieldtype: "Date",
            default: frappe.datetime.get_today(),
            reqd: true
        },
        {
            fieldname: "remove_company_column",
            label: __("Remove Company Column"),
            fieldtype: "Check"
        },
        {
            fieldname: "remove_original_account_column",
            label: __("Remove Original Account Column"),
            fieldtype: "Check"
        },
        {
            fieldname: "remove_voucher_type_column",
            label: __("Remove Voucher Type Column"),
            fieldtype: "Check"
        },
        {
            fieldname: "remove_account_type_column",
            label: __("Remove Account Type Column"),
            fieldtype: "Check"
        }
    ],

    onload: function(report) {
        // 添加"维护映射"按钮
        report.page.add_inner_button(__("Maintain Account Mappings"), function() {
            frappe.set_route("List", "Payment Ledger Mapping");
        });
    },

    refresh: function(report) {
        // 刷新时重新应用筛选条件
    }
};
    